Azure - Manage elastic search data

  • 1. in the Azure server

    1. in the azure_live branch, update the file src/foodexplorer/servicecloud/Database/Elasticsearch.php @line 57 , $this->prefix = 'servicecloud-prod-';

    2. in the azure_test branch, update the file src/foodexplorer/servicecloud/Database/Elasticsearch.php @line 57 , $this->prefix = 'servicecloud-dev-';

    1. We need 2 docs , one for AUTH & another for CREDENTIALS

    2. AUTH doc & CREDENTIALS doc are independent. So we can delete and recreate whenever we want

    1. login to VM in the server/

    2.Open terminal window

    1. TESTING

    
                          curl –user elastic:z0hAfRSdLpcCrz1vJ4cTosgB https://56d2a5f7c15049c4b09b169e2d0f88e0.privatelink.westeurope.azure.elastic-cloud.com:9243
                          
  • 2. FOR TEST ENV

    1. servicecloud-dev-auth/_create/servicecloud-dev-auth

    2. servicecloud-dev-credential/_create/servicecloud-dev-credential

    2. CREATE AUTH

    
                          curl --user elastic:z0hAfRSdLpcCrz1vJ4cTosgB -XPOST  https://56d2a5f7c15049c4b09b169e2d0f88e0.privatelink.westeurope.azure.elastic-cloud.com:9243/servicecloud-dev-auth/_create/servicecloud-dev-auth  -H "Content-Type: application/json" -d  "{\"key\" : \"test\",      \"secret\" : \"test\", \"permission\" : { \"AdministratorAccess\" : true,  \"fieldservice\" : true, \"EmisAccess\" : true,\"EshopAccess\" : true,\"PromioAccess\" : true},\"name\" : \"DEVELOPER\", \"salesOrganisations\" : [\"Admin\"], \"synced\" : false,\"settings\" : {  \"debug\" : { \"show\" : 1,  \"level\" : 5 } } }"
                          

    2. GET ALL AUTH

    
                          curl --user elastic:z0hAfRSdLpcCrz1vJ4cTosgB -XGET  https://56d2a5f7c15049c4b09b169e2d0f88e0.privatelink.westeurope.azure.elastic-cloud.com:9243/_all
                          

    3. GET SPECIFIC AUTH

    
                          curl --user elastic:z0hAfRSdLpcCrz1vJ4cTosgB -XGET  https://56d2a5f7c15049c4b09b169e2d0f88e0.privatelink.westeurope.azure.elastic-cloud.com:9243/servicecloud-dev-auth1/_search?pretty
                        

    4. DELETE AUTH

    
                        curl --user elastic:z0hAfRSdLpcCrz1vJ4cTosgB -XDELETE https://56d2a5f7c15049c4b09b169e2d0f88e0.privatelink.westeurope.azure.elastic-cloud.com:9243/servicecloud-dev-auth1
                        

    5. CREATE CREDENTIALS

    
                        curl --user elastic:z0hAfRSdLpcCrz1vJ4cTosgB -XPOST  https://56d2a5f7c15049c4b09b169e2d0f88e0.privatelink.westeurope.azure.elastic-cloud.com:9243/servicecloud-dev-credential/_create/servicecloud-dev-credential  -H "Content-Type: application/json" -d “{\"key\":\"fieldservice_sap\",\"data\":{\"dbPass\":\"ktetnr6wFWhQb9k8\",\"app_store_sap_user\":\"CPIC_EVA20\",\"redirectUrl\":\"http://18.192.184.82/servicecloud/sso/response.php\",\"karlson_url\":\”https://www.eismannsuchtkunde.de/EismannTestApi/api/sales/savetosales\",\"dbName\":\"servicecloud_db\",\"nearest_cust_password\":\"YW1AYWN0Z21iaC5pbmZvOjdTU2RRcjZ5MVdpVk10VXp1a2IxekE9PQ==\",\"promio_url\":\"https://api.promio-mail.com/1.4/soap/13775.wsdl\",\"app_store_sap_pass\":\"appFro$t\",\"karlson_apikey\":\"7SSdQr6y1WiVMtUzukb1zA==\"}}"
    
    

    GET CREDENTIALS

    
    curl --user elastic:z0hAfRSdLpcCrz1vJ4cTosgB -XGET  https://56d2a5f7c15049c4b09b169e2d0f88e0.privatelink.westeurope.azure.elastic-cloud.com:9243/servicecloud-dev-credential/_search?pretty
    

    DELETE CREDENTIALS

    
    curl --user elastic:z0hAfRSdLpcCrz1vJ4cTosgB -XDELETE https://56d2a5f7c15049c4b09b169e2d0f88e0.privatelink.westeurope.azure.elastic-cloud.com:9243/servicecloud-dev-credential
    

    UPDATE CREDENTIALS

    
    curl --user elastic:z0hAfRSdLpcCrz1vJ4cTosgB -XPOST https://56d2a5f7c15049c4b09b169e2d0f88e0.privatelink.westeurope.azure.elastic-cloud.com:9243/servicecloud-dev-credential/_update/servicecloud-dev-credential/?pretty -d  "{\"doc\":{\"data\":{\"dbPass\":\"servicecloud-db2.cieqcoyvplol.eu-central-1.rds.amazonaws.com\"}}}" -H "Content-Type: application/json"
    
  • 3. FOR LIVE ENV

    1. servicecloud-prod-auth/_create/servicecloud-prod-auth

    2. servicecloud-prod-credential/_create/servicecloud-prod-credential

    2. CREATE AUTH

    
                          curl --user elastic:z0hAfRSdLpcCrz1vJ4cTosgB -XPOST  https://56d2a5f7c15049c4b09b169e2d0f88e0.privatelink.westeurope.azure.elastic-cloud.com:9243/servicecloud-prod-auth/_create/servicecloud-prod-auth  -H "Content-Type: application/json" -d  "{\"key\" : \"test\",      \"secret\" : \"test\", \"permission\" : { \"AdministratorAccess\" : true,  \"fieldservice\" : true, \"EmisAccess\" : true,\"EshopAccess\" : true,\"PromioAccess\" : true},\"name\" : \"DEVELOPER\", \"salesOrganisations\" : [\"Admin\"], \"synced\" : false,\"settings\" : {  \"debug\" : { \"show\" : 1,  \"level\" : 5 } } }"
                          

    2. GET ALL AUTH

    
                          curl --user elastic:z0hAfRSdLpcCrz1vJ4cTosgB -XGET  https://56d2a5f7c15049c4b09b169e2d0f88e0.privatelink.westeurope.azure.elastic-cloud.com:9243/_all
                          

    3. GET SPECIFIC AUTH

    
                          curl --user elastic:z0hAfRSdLpcCrz1vJ4cTosgB -XGET  https://56d2a5f7c15049c4b09b169e2d0f88e0.privatelink.westeurope.azure.elastic-cloud.com:9243/servicecloud-prod-auth1/_search?pretty
                        

    4. DELETE AUTH

    
                        curl --user elastic:z0hAfRSdLpcCrz1vJ4cTosgB -XDELETE https://56d2a5f7c15049c4b09b169e2d0f88e0.privatelink.westeurope.azure.elastic-cloud.com:9243/servicecloud-prod-auth1
                        

    5. CREATE CREDENTIALS

    
                        curl --user elastic:z0hAfRSdLpcCrz1vJ4cTosgB -XPOST  https://56d2a5f7c15049c4b09b169e2d0f88e0.privatelink.westeurope.azure.elastic-cloud.com:9243/servicecloud-prod-credential/_create/servicecloud-prod-credential  -H "Content-Type: application/json" -d “{\"key\":\"fieldservice_sap\",\"data\":{\"dbPass\":\"ktetnr6wFWhQb9k8\",\"app_store_sap_user\":\"CPIC_EVA20\",\"redirectUrl\":\"http://18.192.184.82/servicecloud/sso/response.php\",\"karlson_url\":\”https://www.eismannsuchtkunde.de/EismannTestApi/api/sales/savetosales\",\"dbName\":\"servicecloud_db\",\"nearest_cust_password\":\"YW1AYWN0Z21iaC5pbmZvOjdTU2RRcjZ5MVdpVk10VXp1a2IxekE9PQ==\",\"promio_url\":\"https://api.promio-mail.com/1.4/soap/13775.wsdl\",\"app_store_sap_pass\":\"appFro$t\",\"karlson_apikey\":\"7SSdQr6y1WiVMtUzukb1zA==\"}}"
    
    

    GET CREDENTIALS

    
    curl --user elastic:z0hAfRSdLpcCrz1vJ4cTosgB -XGET  https://56d2a5f7c15049c4b09b169e2d0f88e0.privatelink.westeurope.azure.elastic-cloud.com:9243/servicecloud-prod-credential/_search?pretty
    

    DELETE CREDENTIALS

    
    curl --user elastic:z0hAfRSdLpcCrz1vJ4cTosgB -XDELETE https://56d2a5f7c15049c4b09b169e2d0f88e0.privatelink.westeurope.azure.elastic-cloud.com:9243/servicecloud-prod-credential
    

    UPDATE CREDENTIALS

    
    curl --user elastic:z0hAfRSdLpcCrz1vJ4cTosgB -XPOST https://56d2a5f7c15049c4b09b169e2d0f88e0.privatelink.westeurope.azure.elastic-cloud.com:9243/servicecloud-prod-credential/_update/servicecloud-prod-credential/?pretty -d  "{\"doc\":{\"data\":{\"dbPass\":\"servicecloud-db2.cieqcoyvplol.eu-central-1.rds.amazonaws.com\"}}}" -H "Content-Type: application/json"